﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace test_6_18
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double a = double.Parse(textBox2.Text);
            double b = double.Parse(textBox3.Text);
            Cal2 calculator= new Cal2();
            switch(comboBox1.Text)
            {
                case "+":
                    textBox1.Text = calculator.Add(a, b).ToString();
                    break;
                case "-":
                    textBox1.Text = calculator.Sub(a, b).ToString();
                    break;
                case "*":
                    textBox1.Text = calculator.Mul(a, b).ToString();
                    break;
                case "/":
                    textBox1.Text = calculator.Div(a, b).ToString();
                    break;

            }
            
        }
    }
}
